package com.shawn.spring.boot.mybatis.service;

import com.shawn.spring.boot.mybatis.entity.Menu;
import com.shawn.spring.boot.mybatis.mapper.MenuMapper;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author shawn
 * @since 2020/8/30
 */
@Service
public class MenuServiceImpl implements MenuService {

  @Autowired private MenuMapper mapper;

  @Override
  public void insert(Menu menu) {
    mapper.insert(menu);
  }

  @Override
  public void update(Menu menu) {
    mapper.update(menu);
  }

  @Override
  public void delete(long id) {
    mapper.delete(id);
  }

  @Override
  public List<Menu> findAll() {
    return mapper.selectAll();
  }

  @Override
  public Menu findById(long id) {
    return mapper.selectById(id);
  }
}
